from restful.api.info import PostsList
from restful.api.info.Admin import AdminCheck, AdminDisable
from restful.api.info.AuthorDetail import AuthorDetail
from restful.api.info.Data import Data
from restful.api.info.My import MyPosts, MyComments, MyLikes, MyFollows
from restful.api.info.PersonalDetail import PersonalDetail
from restful.api.info.PostDetail import PostDetail
from restful.api.info.PostsList import PostsListBySort, PostsListBySimilar, PostsListByMyFollowing, PostsListByTopHot, \
    PostsListByTopRecent
from restful.api.info.Publish import Publish
from restful.api.info.System import SystemAllUrls, SystemAllFunctions
from restful.api.info.information import Intro, Background, Role, Icon
from restful.api.service.CommentOrCancel import CommentOrCancel
from restful.api.service.FollowOrCancel import FollowOrCancel
from restful.api.service.LikeOrCancel import LikeOrCancel
from restful.api.service.LoginAndRegister import SerRegister, SerLogin, AdminLogin
from restful.api.service.PostDelete import PostDelete
from restful.atomic.info.PostComment import PostComment
from restful.atomic.info.UserDetail import UserDetail
from restful.atomic.info.UserFollow import UserFollow
from restful.atomic.info.UserPosts import UserPosts
from restful.atomic.info.like.PostLike import PostLike
from restful.atomic.info.like.UserLike import UserLike

def restful_register(api):
    api.add_resource(PostLike, '/post/like')  # 帖子点赞相关操作
    api.add_resource(UserLike, '/user/like')  # 用户点赞相关操作
    api.add_resource(PostComment, '/post/comment')  # 帖子评论相关操作
    api.add_resource(UserDetail, '/user/detail')  # 用户详情
    api.add_resource(UserFollow, '/user/follow')  # 用户关注
    api.add_resource(UserPosts, '/user/posts')

    api.add_resource(SystemAllUrls,'/api/system/all/urls')
    api.add_resource(SystemAllFunctions,'/api/system/all/functions')

    api.add_resource(SerRegister, '/api/ser/register')
    api.add_resource(SerLogin, '/api/ser/login')
    api.add_resource(AdminLogin, '/api/admin/login')

    api.add_resource(PostsListByTopHot, '/api/posts/list/by/top/hot')
    api.add_resource(PostsListByTopRecent, '/api/posts/list/by/top/recent')
    api.add_resource(PostsListBySort, '/api/posts/list/by/sort')
    api.add_resource(PostsListBySimilar, '/api/posts/list/by/similar')
    api.add_resource(PostsListByMyFollowing, '/api/posts/list/by/following')

    api.add_resource(AuthorDetail, '/api/author/detail')
    api.add_resource(PostDetail, '/api/post/detail')
    api.add_resource(PersonalDetail,'/api/personal/detail')

    api.add_resource(MyPosts, '/api/my/posts')
    api.add_resource(MyComments,'/api/my/comments')
    api.add_resource(MyLikes,'/api/my/likes')
    api.add_resource(MyFollows,'/api/my/follow')

    api.add_resource(Publish,'/api/publish')

    api.add_resource(Data,'/api/data')

    api.add_resource(LikeOrCancel,'/api/like/or/cancel')
    api.add_resource(FollowOrCancel,'/api/follow/or/cancel')
    api.add_resource(CommentOrCancel,'/api/comment/or/cancel')
    api.add_resource(PostDelete,'/api/post/delete')

    api.add_resource(Intro,'/api/intro')
    api.add_resource(Icon,'/api/icon')
    api.add_resource(Background,'/api/background')
    api.add_resource(Role,'/api/role')

    api.add_resource(AdminCheck,'/api/admin/check')
    api.add_resource(AdminDisable,'/api/admin/disable')
